package com.eight.travel.controller;

import com.eight.travel.pojo.StorePic;
import com.eight.travel.service.StorePicService;
import com.eight.travel.utils.BaseResp;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
public class StorePicController {

    @Autowired
    StorePicService storePicService;

    //添加商场介绍图片
    @ApiOperation(value = "添加商场介绍图片",notes = "需传入 商场图片介绍的信息")
    @PostMapping("/StorePic/addPic")
    @ResponseBody
    public BaseResp addPic(@RequestBody StorePic storePic){
        return storePicService.addPic(storePic);
    }

    //删除商场介绍图片
    @ApiOperation(value = "删除商场介绍图片",notes = "需传入 商场图片信息的id")
    @PostMapping("/StorePic/deletePic")
    public BaseResp deletePic(Integer spid){
        return storePicService.deletePic(spid);
    }

    //查看指定商场的图片
    @ApiOperation(value = "查看指定商场的图片",notes = "需传入 商场的id")
    @GetMapping("/StorePic/selectBySid")
    public BaseResp selectBySid(Integer sid){
        return storePicService.selectBySid(sid);
    }
}
